package me.leiusual.sharing.repository

import io.reactivex.Single
import me.leiusual.sharing.api.ApiSharing
import me.leiusual.sharing.api.model.Bank
import javax.inject.Inject
import javax.inject.Singleton

/**
 * author: leiusual
 * create on: 2019-07-27
 * description:
 */
@Singleton
class BankRepository @Inject constructor(
    private val apiSharing: ApiSharing
) {

  fun bankAccountType(): Single<Map<String, String>> {
    return apiSharing.bankAccountType()
  }

  fun bankDelete(baId: Long): Single<Unit> {
    return apiSharing.bankDelete(baId)
  }

  fun bankList(): Single<List<Bank>> {
    return apiSharing.bankList()
  }

  fun bankUpdate(bank: Bank): Single<Unit> {
    return apiSharing.bankUpdate(bank)
  }
}